package picture;

public class Triangle extends Shape {
	private double r1, r2, r3;

	public Triangle(String s, double a, double b, double c) {
		super(s);
		this.r1 = a;
		this.r2 = b;
		this.r3 = c;
	}

	@Override
	public void show() {
		super.show();
		System.out.println("三条边长是" + r1 + "," + r2 + "," + r3);
	}

	@Override
	public double calcArea() {
		double area = calcPremter() / 2;

		return Math.sqrt(area * (area - r1) * (area - r2) * (area - r3));// @
	}

	@Override
	public double calcPremter() {

		return r1 + r2 + r3;
	}

}
